import { appFetch } from "@/utils/tools";


export const getWebsitesPaginationApi = (body: any) => appFetch(
  '/api/websites/getWebsitesPagination',
  {
    method: 'post',
    body: JSON.stringify(body)
  }
)

export const getAllWebsitesByTypeIdApi = (id: string) => appFetch(
  '/api/websites/getAllWebsitesByCondition',
  {
    method: 'post',
    body: JSON.stringify({
      type: id
    })
  }
)

export const addAllWebsiteApi = (body = {}) => appFetch(
  '/api/websites/addWebsite',
  {
    method: 'put',
    body: JSON.stringify(body)
  }
)

export const updateWebsiteApi = (_id: string, body: Object) => appFetch(
  `/api/websites/updateWebsite/${_id}`,
  {
    method: 'put',
    body: JSON.stringify(body)
  }
)

export const deleteWebsiteApi = (ids: string[]) => appFetch(
  `/api/websites/deleteWebsites`,
  {
    method: 'delete',
    body: JSON.stringify({
      ids
    })
  }
)